package com.dhy.service.imp;

import com.dhy.mapper.BaseMapper;
import com.dhy.pojo.Department;
import com.dhy.query.BaseQuery;
import com.dhy.query.DepartmentQuery;
import com.dhy.service.IBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

public class BaseServiceImpl<T> implements IBaseService<T> {

    @Autowired
    private BaseMapper<T> baseMapper;

    @Override
    public void insert(T t) {
        baseMapper.insert(t);
    }

    @Override
    public void deleteById(Long id) {
        baseMapper.deleteById(id);
    }

    @Override
    public void update(T t) {
        baseMapper.update(t);
    }

    @Override
    public T selectById(Long id) {
        return baseMapper.selectById(id);
    }

    @Override
    public Long selectPageSize() {
        return baseMapper.selectPageSize();
    }

    @Override
    public List<T> selectLimit(BaseQuery baseQuery) {
        return baseMapper.selectLimit(baseQuery);
    }

    @Override
    public List<T> selectAll() {
        return baseMapper.selectAll();
    }

    @Override
    public Long deleteByIds( List<Long> lists){
        return baseMapper.deleteByIds(lists);
    }
}
